<%--
  Created by IntelliJ IDEA.
  User: ykj
  Date: 16/4/4
  Time: 下午2:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script>
    $(document).ready(function () {
        //Get context with jQuery - using jQuery's .get() method.
        var ctx = $("#myChart").get(0).getContext("2d");
        //This will get the first returned node in the jQuery collection.
        var myNewChart = new Chart(ctx);
        var data = {
            labels: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            datasets: [
                {
                    fillColor: "rgba(151,187,205,0.5)",
                    strokeColor: "rgba(151,187,205,1)",
                    data: [65, 59, 90, 81, 56, 55, 40, 10, 20, 30, 15, 66]
                },
                {
                    fillColor: "rgba(220,220,220,0.5)",
                    strokeColor: "rgba(220,220,220,1)",
                    data: [28, 48, 40, 19, 96, 27, 100, 80, 70, 66, 55, 90]
                }
            ]
        };
        $.ajax({
            url: "../purchases/monthDataByUser",
            type: "GET",
            error: function () {
                $.messager.alert("网络超时，请稍后再试");
            },
            success: function (result) {
                console.log(result);
                data.datasets[0].data = result[0];
                data.datasets[1].data = result[1];
                myNewChart.Bar(data);
            }
        });
    });
</script>
<canvas id="myChart" width="600" height="600"></canvas>
<div class="chart-des">
    <div style="overflow: hidden">
        <div style="background:rgba(151,187,205,0.5);width: 50px;height: 10px;float: left;"></div>
        <div style="float: left;margin-left: 5px;">投资金额</div>
    </div>
    <div style="overflow: hidden;margin-top: 10px;">
        <div style="background:rgba(220,220,220,0.5);width: 50px;height: 10px;float: left;"></div>
        <div style="float: left;margin-left: 5px;">赎回金额</div>
    </div>
</div>
